<template>
  <div class="teleport" :style="positionStyle">
    <RenderCpn :render="render"></RenderCpn>
  </div>
</template>

<script>
import RenderCpn from "./renderCpn";
export default {
  props: ["position", "render"],
  data() {
    return {
      topNum: this.position.y,
      leftNum: this.position.x,
    };
  },
  components: { RenderCpn },
  computed: {
    positionStyle() {
      return { top: this.topNum + "px", left: this.leftNum + "px" };
    },
  },
};
</script>

<style scoped lang="less">
.teleport {
  position: absolute;
  display: inline-block;
}
</style>
